<template>
  <div class="page">
    <div class="banner">
    </div>
    <div class="exchange">
      <div class="title">
        <span class="ye">餘額:</span>
        <span class="num">999</span>
        <span class="max">MAX</span>
      </div>

      <div class="exchange-box">
       <div class="con">
         <div class="brand">CFX (eSpace)</div>
         <input type="text" placeholder="請輸入數量">
       </div>
      </div>
      <div class="exchange-icon"><img src="../assets/chain/exchange.png" alt=""></div>
      <div class="exchange-box">
        <div class="con">
          <div class="brand">CFX (CORE)</div>
          <input type="text" placeholder="請輸入數量">
        </div>
      </div>

      <div class="address">
        <div class="text" >aaaaaaaaaaaaaaaaaaaaaaaaaa</div><button @click="copy" data-clipboard-text="xxx" class="paste-btn"><img style="width: 14px;height: 14px" src="../assets/chain/paste.png" alt=""><span>粘 貼</span></button>
      </div>
      <button class="submit"><img src="../assets/chain/submit.png" alt=""><span>跨 鏈</span></button>
    </div>
  </div>
</template>

<script>
import Clipboard from "clipboard";

export default {
  name: "Chain",
  methods:{
    copy() {
      const clip = new Clipboard('.copy')
      clip.on('success', e => {
        this.copySuccess = true;
      })
      clip.on('fail', e => {
        console.log('浏览器不支持')
        clip.destroy();
      })
    }
  }
}
</script>

<style scoped lang="less">
.banner {
  background: url('@/assets/chain/banner.png') no-repeat center;
  background-size: cover;
}
.exchange{
  margin-top: 22px;
  padding:0 10px;
  width: 380px;
  height: 400px;
  border-radius: 6px;
  opacity: 1;
  background: linear-gradient(125deg, #FFA000 23%, #FFECB3 130%);
}
.exchange-icon{
  width: 40px;
  height: 40px;
  margin:9px auto;
  img{
    display: block;
    max-width: 100%;
    max-height: 100%;
  }
}
.submit{
  width: 114px;
  height: 30px;
  border-radius: 4px;
  opacity: 1;
  background: #9C27B0;
  font-size: 18px;
  font-weight: bold;
  color:#fff;
  margin:19px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  img{
    width: 16px;
    height: 16px;
    margin-right: 9px;
  }
}
.address{
  margin-top: 20px;
  width: 380px;
  height: 48px;
  border-radius: 5px;
  opacity: 1;
  box-sizing: border-box;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 14px 10px 12px 21px;
  .text{
    border-radius: 4px;
    opacity: 1;
    background: #FFFFFF;
    box-sizing: border-box;
    border: 1px solid #E1BEE7;
    outline: none;
    padding-left: 14px;
    overflow: hidden;
  }
}
.paste-btn{
  width: 75px;
  height: 21px;
  line-height: 21px;
  font-size: 12px;
  border-radius: 4px;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;

  img{
    margin-right: 4px;
  }
  background: #9C27B0;
  color:#fff;
}

.title{
  padding-top: 14px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 22px;
  margin-bottom: 11px;
  .max{
    font-weight: 900;
    line-height: 22px;
    color:#9C27B0;
    margin-left: 12px;
  }
  .num{
    font-weight: 900;
  }
  .ye{
    color:#9C27B0;
  }
}

.exchange-box{
  display: flex;
  justify-content: flex-end;
  .con{
    box-sizing: border-box;
    width: 350px;
    position: relative;
    height: 81px;
    border-radius: 5px;
    background: #fff;
    padding-top: 18px;
    padding-left: 41px;
    padding-right: 19px;
    .brand{
      position: absolute;
      left: -34px;
      top: 7px;
      width: 68px;
      height: 68px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #E1BEE7;
      font-size: 14px;
      font-weight: normal;
      line-height: 22px;
      text-align: center;
      color: #9C27B0;
      border-radius: 6px;
    }
    input{
      width: 289px;
      height: 42px;
      border-radius: 4px;
      opacity: 1;
      outline: none;
      background: #FFFFFF;
      color:#6E767D;
      font-size: 12px;
      line-height: 22px;
      padding:10px;
      box-sizing: border-box;
      border: 1px solid #E1BEE7;
    }
  }
}
</style>